import type { App } from 'vue'
import ModernButton from './ModernButton.vue'
import ModernCard from './ModernCard.vue'
import ModernNav from './ModernNav.vue'
import ModernTable from './ModernTable.vue'
import ThemeSwitcher from './ThemeSwitcher.vue'
import LoadingSpinner from './LoadingSpinner.vue'

// 组件列表
const components = [
  ModernButton,
  ModernCard,
  ModernNav,
  ModernTable,
  ThemeSwitcher,
  LoadingSpinner,
]

// 安装函数
export function install(app: App) {
  components.forEach(component => {
    app.component(component.name || component.__name, component)
  })
}

// 默认导出
export default {
  install
}

// 具名导出
export {
  ModernButton,
  ModernCard,
  ModernNav,
  ModernTable,
  ThemeSwitcher,
  LoadingSpinner,
}
